package Air_war;

import java.awt.image.BufferedImage;
//天空类
public class Sky extends FlyingObject{
    private int speed;//移动
    private int y1;//第二张天空图片的y坐标

    public Sky() {
        super(World.WIDTH,World.HEIGHT,0,0);
        speed = 1;
        y1 = World.HEIGHT;
    }
    //重写step移动
    public void step() {
        y+=speed;//y  向下
        y1+=speed;//y  向下
        if (y>=World.HEIGHT){//若天空y大于等于窗口的
            y = -World.HEIGHT;//则返回负的窗口高
        }
        if (y1>=World.HEIGHT){//若天空y1大于等于窗口的高
            y1 = -World.HEIGHT;//则返回负的窗口的高
        }
    }

    public BufferedImage getImage() {
        return Images.sky;
    }
    //获取y1坐标
    public int getY1(){return y1;}
}
